<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ASK vs Agent - AI编程助手功能对比</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background-color: #f8f9fa;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        }
        .feature-icon {
            width: 60px;
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 12px;
            margin-bottom: 1rem;
        }
        .comparison-table th, .comparison-table td {
            padding: 1rem;
            text-align: left;
            border-bottom: 1px solid #e2e8f0;
        }
        .comparison-table th {
            background-color: #f7fafc;
            font-weight: 600;
        }
        .comparison-table tr:hover td {
            background-color: #f8f9fa;
        }
        .highlight-box {
            border-left: 4px solid #6e8efb;
            background-color: #f8fafc;
            padding: 1.5rem;
            border-radius: 0 8px 8px 0;
        }
        .mermaid {
            background-color: white;
            padding: 1.5rem;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.05);
        }
    </style>
</head>
<body class="antialiased">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-6xl px-4">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold mb-4">ASK与Agent模式</h1>
                    <h2 class="text-2xl md:text-3xl font-semibold mb-6">AI编程助手的两种交互方式</h2>
                    <p class="text-lg opacity-90 mb-8">探索Cursor编辑器中两种AI辅助编程模式的核心差异，了解如何根据任务需求选择最适合的工具。</p>
                    <div class="flex space-x-4">
                        <a href="#comparison" class="bg-white text-indigo-600 px-6 py-3 rounded-lg font-medium hover:bg-opacity-90 transition">功能对比</a>
                        <a href="#scenarios" class="bg-indigo-700 text-white px-6 py-3 rounded-lg font-medium hover:bg-opacity-90 transition">使用场景</a>
                    </div>
                </div>
                <div class="md:w-1/2 flex justify-center">
                    <div class="relative w-full max-w-md">
                        <div class="absolute -top-6 -left-6 w-32 h-32 bg-white bg-opacity-10 rounded-2xl"></div>
                        <div class="absolute -bottom-6 -right-6 w-32 h-32 bg-white bg-opacity-10 rounded-2xl"></div>
                        <div class="relative bg-white bg-opacity-20 backdrop-blur-sm p-8 rounded-2xl shadow-xl">
                            <h3 class="text-xl font-bold mb-4">核心区别概览</h3>
                            <ul class="space-y-3">
                                <li class="flex items-start">
                                    <i class="fas fa-code text-indigo-200 mt-1 mr-3"></i>
                                    <span>ASK: 针对当前代码的即时问答</span>
                                </li>
                                <li class="flex items-start">
                                    <i class="fas fa-robot text-indigo-200 mt-1 mr-3"></i>
                                    <span>Agent: 跨文件的智能分析与执行</span>
                                </li>
                                <li class="flex items-start">
                                    <i class="fas fa-bolt text-indigo-200 mt-1 mr-3"></i>
                                    <span>根据任务复杂度选择合适模式</span>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Introduction Section -->
    <section class="py-16 px-4 md:px-0 bg-white">
        <div class="container mx-auto max-w-6xl px-4">
            <div class="grid grid-cols-1 md:grid-cols-2 gap-12">
                <div class="bg-gray-50 p-8 rounded-xl card-hover">
                    <div class="feature-icon bg-indigo-100 text-indigo-600">
                        <i class="fas fa-comment-alt text-2xl"></i>
                    </div>
                    <h3 class="text-2xl font-bold mb-3">ASK (AI Sidebar Knowledge)</h3>
                    <p class="text-gray-600 mb-4">交互问答聊天功能，位于编辑器侧边栏，提供快速的代码解释和问题解答。</p>
                    <ul class="space-y-2 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-indigo-500 mt-1 mr-2"></i>
                            <span>仅基于当前可见内容和上下文回答问题</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-indigo-500 mt-1 mr-2"></i>
                            <span>轻量级交互，资源消耗低</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-indigo-500 mt-1 mr-2"></i>
                            <span>适合快速解答和简单修改建议</span>
                        </li>
                    </ul>
                </div>
                <div class="bg-gray-50 p-8 rounded-xl card-hover">
                    <div class="feature-icon bg-purple-100 text-purple-600">
                        <i class="fas fa-robot text-2xl"></i>
                    </div>
                    <h3 class="text-2xl font-bold mb-3">Agent</h3>
                    <p class="text-gray-600 mb-4">更强大的AI助手模式，能够主动浏览和理解整个代码库，执行复杂任务。</p>
                    <ul class="space-y-2 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-purple-500 mt-1 mr-2"></i>
                            <span>主动探索和分析项目结构</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-purple-500 mt-1 mr-2"></i>
                            <span>执行跨文件的搜索和分析任务</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-purple-500 mt-1 mr-2"></i>
                            <span>适合复杂问题和系统级分析</span>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </section>

    <!-- Comparison Section -->
    <section id="comparison" class="py-16 px-4 md:px-0 bg-gray-50">
        <div class="container mx-auto max-w-6xl px-4">
            <h2 class="text-3xl font-bold text-center mb-12">主要区别</h2>
            <div class="bg-white rounded-xl shadow-sm overflow-hidden">
                <table class="comparison-table w-full">
                    <thead>
                        <tr>
                            <th class="w-1/4">特性</th>
                            <th class="w-3/8">ASK</th>
                            <th class="w-3/8">Agent</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td class="font-medium">代码理解范围</td>
                            <td>仅当前可见内容</td>
                            <td>整个代码库</td>
                        </tr>
                        <tr>
                            <td class="font-medium">主动性</td>
                            <td>被动回答问题</td>
                            <td>主动探索和分析</td>
                        </tr>
                        <tr>
                            <td class="font-medium">执行能力</td>
                            <td>仅提供建议和解释</td>
                            <td>可执行搜索和分析任务</td>
                        </tr>
                        <tr>
                            <td class="font-medium">适用场景</td>
                            <td>简单问题和当前文件解释</td>
                            <td>复杂问题和跨文件分析</td>
                        </tr>
                        <tr>
                            <td class="font-medium">资源消耗</td>
                            <td>较低</td>
                            <td>较高</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </section>

    <!-- Visualization Section -->
    <section class="py-16 px-4 md:px-0 bg-white">
        <div class="container mx-auto max-w-6xl px-4">
            <h2 class="text-3xl font-bold text-center mb-12">功能关系可视化</h2>
            <div class="mermaid">
                graph TD
                    A[AI编程助手] --> B(ASK模式)
                    A --> C(Agent模式)
                    B --> D[当前文件内容]
                    B --> E[即时问答]
                    B --> F[轻量级]
                    C --> G[整个项目]
                    C --> H[主动分析]
                    C --> I[任务执行]
                    C --> J[资源消耗高]
            </div>
        </div>
    </section>

    <!-- Usage Scenarios -->
    <section id="scenarios" class="py-16 px-4 md:px-0 bg-gray-50">
        <div class="container mx-auto max-w-6xl px-4">
            <h2 class="text-3xl font-bold text-center mb-12">使用场景指南</h2>
            <div class="grid grid-cols-1 md:grid-cols-2 gap-8">
                <div>
                    <h3 class="text-2xl font-bold mb-6 text-indigo-600 flex items-center">
                        <i class="fas fa-comment-alt mr-3"></i>
                        适合使用ASK的情况
                    </h3>
                    <ul class="space-y-4">
                        <li class="flex items-start bg-white p-4 rounded-lg card-hover">
                            <div class="bg-indigo-100 text-indigo-600 rounded-full w-8 h-8 flex items-center justify-center flex-shrink-0 mr-4">
                                <i class="fas fa-question"></i>
                            </div>
                            <div>
                                <h4 class="font-medium mb-1">简单代码疑问</h4>
                                <p class="text-gray-600">对当前正在编辑的代码有简单疑问</p>
                            </div>
                        </li>
                        <li class="flex items-start bg-white p-4 rounded-lg card-hover">
                            <div class="bg-indigo-100 text-indigo-600 rounded-full w-8 h-8 flex items-center justify-center flex-shrink-0 mr-4">
                                <i class="fas fa-file-code"></i>
                            </div>
                            <div>
                                <h4 class="font-medium mb-1">代码片段解释</h4>
                                <p class="text-gray-600">需要对特定代码片段的解释</p>
                            </div>
                        </li>
                        <li class="flex items-start bg-white p-4 rounded-lg card-hover">
                            <div class="bg-indigo-100 text-indigo-600 rounded-full w-8 h-8 flex items-center justify-center flex-shrink-0 mr-4">
                                <i class="fas fa-lightbulb"></i>
                            </div>
                            <div>
                                <h4 class="font-medium mb-1">简单修改建议</h4>
                                <p class="text-gray-600">请求简单的代码示例或修改建议</p>
                            </div>
                        </li>
                    </ul>
                </div>
                <div>
                    <h3 class="text-2xl font-bold mb-6 text-purple-600 flex items-center">
                        <i class="fas fa-robot mr-3"></i>
                        适合使用Agent的情况
                    </h3>
                    <ul class="space-y-4">
                        <li class="flex items-start bg-white p-4 rounded-lg card-hover">
                            <div class="bg-purple-100 text-purple-600 rounded-full w-8 h-8 flex items-center justify-center flex-shrink-0 mr-4">
                                <i class="fas fa-sitemap"></i>
                            </div>
                            <div>
                                <h4 class="font-medium mb-1">项目结构理解</h4>
                                <p class="text-gray-600">需要理解项目整体结构</p>
                            </div>
                        </li>
                        <li class="flex items-start bg-white p-4 rounded-lg card-hover">
                            <div class="bg-purple-100 text-purple-600 rounded-full w-8 h-8 flex items-center justify-center flex-shrink-0 mr-4">
                                <i class="fas fa-search"></i>
                            </div>
                            <div>
                                <h4 class="font-medium mb-1">功能定位</h4>
                                <p class="text-gray-600">查找特定功能在哪些文件中实现</p>
                            </div>
                        </li>
                        <li class="flex items-start bg-white p-4 rounded-lg card-hover">
                            <div class="bg-purple-100 text-purple-600 rounded-full w-8 h-8 flex items-center justify-center flex-shrink-0 mr-4">
                                <i class="fas fa-project-diagram"></i>
                            </div>
                            <div>
                                <h4 class="font-medium mb-1">代码依赖分析</h4>
                                <p class="text-gray-600">分析复杂的代码依赖关系</p>
                            </div>
                        </li>
                        <li class="flex items-start bg-white p-4 rounded-lg card-hover">
                            <div class="bg-purple-100 text-purple-600 rounded-full w-8 h-8 flex items-center justify-center flex-shrink-0 mr-4">
                                <i class="fas fa-file-import"></i>
                            </div>
                            <div>
                                <h4 class="font-medium mb-1">跨文件修改</h4>
                                <p class="text-gray-600">需要跨多个文件的代码理解和修改</p>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </section>

    <!-- Performance Section -->
    <section class="py-16 px-4 md:px-0 bg-white">
        <div class="container mx-auto max-w-6xl px-4">
            <div class="highlight-box">
                <h3 class="text-2xl font-bold mb-4 flex items-center">
                    <i class="fas fa-tachometer-alt mr-3 text-indigo-600"></i>
                    性能考虑
                </h3>
                <p class="mb-4">Agent模式由于需要索引和理解整个代码库，会消耗更多的计算资源和额度，而ASK则更轻量级，适合快速问答交互。根据任务复杂度和问题范围，选择合适的模式可以使您的AI辅助编程体验更加高效。</p>
                <div class="bg-white p-6 rounded-lg shadow-sm mt-6">
                    <div class="flex items-center mb-4">
                        <div class="w-1/2 text-center">
                            <div class="text-4xl font-bold text-indigo-600 mb-2">ASK</div>
                            <div class="h-2 bg-indigo-100 rounded-full overflow-hidden">
                                <div class="h-full bg-indigo-500" style="width: 30%"></div>
                            </div>
                            <p class="text-sm text-gray-500 mt-2">资源消耗: 低</p>
                        </div>
                        <div class="w-1/2 text-center">
                            <div class="text-4xl font-bold text-purple-600 mb-2">Agent</div>
                            <div class="h-2 bg-purple-100 rounded-full overflow-hidden">
                                <div class="h-full bg-purple-500" style="width: 80%"></div>
                            </div>
                            <p class="text-sm text-gray-500 mt-2">资源消耗: 高</p>
                        </div>
                    </div>
                    <p class="text-center text-gray-600">根据任务需求合理选择模式，平衡资源消耗与功能需求。</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-10 px-4">
        <div class="container mx-auto max-w-6xl px-4">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold text-white mb-2">技术小馆</h3>
                    <a href="http://www.yuque.com/jtostring" class="text-gray-400 hover:text-white transition">http://www.yuque.com/jtostring</a>
                </div>
                <div class="flex space-x-4">
                    <a href="#" class="w-10 h-10 bg-gray-800 rounded-full flex items-center justify-center hover:bg-gray-700 transition">
                        <i class="fab fa-github"></i>
                    </a>
                    <a href="#" class="w-10 h-10 bg-gray-800 rounded-full flex items-center justify-center hover:bg-gray-700 transition">
                        <i class="fab fa-twitter"></i>
                    </a>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-500 text-sm">
                © 2023 技术小馆. All rights reserved.
            </div>
        </div>
    </footer>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            mermaid.initialize({
                startOnLoad: true,
                theme: 'default',
                flowchart: {
                    useMaxWidth: false,
                    htmlLabels: true,
                    curve: 'basis'
                }
            });

            // 平滑滚动
            document.querySelectorAll('a[href^="#"]').forEach(anchor => {
                anchor.addEventListener('click', function (e) {
                    e.preventDefault();
                    document.querySelector(this.getAttribute('href')).scrollIntoView({
                        behavior: 'smooth'
                    });
                });
            });
        });
    </script>
</body>
</html>